package com.itheima.Day0610.Demo02.Dao;

import com.itheima.Day0610.Demo02.Domain.Student;

import java.util.ArrayList;

public class StudentDao {
    ArrayList<Student> list = new ArrayList<>();

    public void addStudent(Student s) {
        list.add(s);
    }

    public ArrayList<Student> findStudent() {
        return list;
    }

    public void deleteStudent(int index) {
        list.remove(index);
    }

    public void updateStudent(int index,Student s) {
       Student stu = list.get(index);
       stu.setName(s.getName());
        stu.setName(s.getName());
        stu.setAge(s.getAge());
        stu.setBirthday(s.getBirthday());

    }
}
